self.build_requirements(pkg, target, Target, &mut HashSet::new());
}
+ self.compilation.extra_env.insert("NUM_JOBS".to_string(),
+ Some(self.config.jobs().to_string()));
self.compilation.root_output = self.layout(KindTarget).proxy().dest().clone();
self.compilation.deps_output = self.layout(KindTarget).proxy().deps().clone();
* `OUT_DIR` - the folder in which all output should be placed.
* `TARGET` - the target triple that is being compiled for. Native code should be
compiled for this triple.
+* `NUM_JOBS` - the parallelism specified as the top-level parallelism. This can
+ be useful to pass a `-j` parameter to a system like `make`.
* `DEP_<name>_OUT_DIR` - This variable is present for all immediate dependencies
of the package being built. The `<name>` will be the
package's name, in uppercase, with `-` characters
.file("src/foo.rs", format!(r#"
use std::os;
fn main() {{
+ let _ncpus = os::getenv("NUM_JOBS").unwrap();
let out = os::getenv("OUT_DIR").unwrap();
assert!(out.as_slice().starts_with(r"{0}"));
assert!(Path::new(out).is_dir());